home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 45reiserfs / choices next >
Encoding:
Text File  |  2009-04-19  |  1.3 KB  |  67 lines

  1. #!/bin/sh
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. set -e
  6.  
  7. dev=$1
  8. id=$2
  9. part=$dev/$id
  10.  
  11. cd $dev
  12.  
  13. [ -f $part/method -a -f $part/acting_filesystem ] || exit 0
  14.  
  15. filesystem=$(cat $part/acting_filesystem)
  16.  
  17. case "$filesystem" in
  18.     reiserfs)
  19.     :
  20.     ;;
  21.     *)
  22.     exit 0
  23.     ;;
  24. esac
  25.  
  26. choice_mountpoint () {
  27.     if [ -f $part/mountpoint ]; then
  28.         mp=$(cat $part/mountpoint)
  29.     else
  30.         db_metaget partman-basicfilesystems/text/no_mountpoint description
  31.         mp="$RET"
  32.     fi
  33.     db_metaget partman-reiserfs/text/specify_mountpoint description
  34.     printf "mountpoint\t%s\${!TAB}%s\n" "$RET" "$mp"
  35. }
  36.  
  37. choice_options () {
  38.     db_metaget partman-basicfilesystems/text/options description
  39.     printf "options\t%s\${!TAB}%.45s\n" "$RET" "$(get_mountoptions $dev $id)"
  40. }
  41.  
  42. choice_label () {
  43.     # allow to set label only if the partition is to be formatted
  44.     [ -f $part/format ] || return 0
  45.     [ ! -f $part/formatted \
  46.       -o $part/formatted -ot $part/method \
  47.       -o $part/formatted -ot $part/filesystem ] || return 0
  48.     case "$filesystem" in
  49.         reiserfs)
  50.         if [ -f $part/label ]; then
  51.             label=$(cat $part/label)
  52.         else
  53.             db_metaget partman-basicfilesystems/text/none description
  54.             label=$RET
  55.         fi
  56.         db_metaget partman-basicfilesystems/text/specify_label description
  57.         printf "label\t%s\${!TAB}%s\n" "$RET" "$label"
  58.         ;;
  59.     esac
  60. }
  61.  
  62. choice_mountpoint
  63.  
  64. choice_options
  65.  
  66. choice_label
  67.